<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<script>
	//封装自己的push,pop,unshift,shift方法(数组)
	/*var arr=[1,2,3,4,5,6,7];
	function mypush(arr,p){
		arr[arr.length]=p;
		console.log(arr);
	}
	mypush(arr,8);*/

	/*var arr=[1,2,3,4,5,6,7];
	function mypop(arr,p){
		arr1=[];
		for(var i=0;i<arr.length-1;i++){
			arr1.push(arr[i]);
		}
		console.log(arr1);
	}
	mypop(arr);*/

	/*var arr=[1,2,3,4,5,6,7];
	function myunshift(arr,un){
		var un1=[];
		for(var i=0;i<arr.length;i++){
			un1.push(arr[i]);
		}
		console.log(un1);
	}
 	myunshift(arr,0);*/

 	var arr=[1,2,3,4,5,6,7];
 	function myshift(arr){
 		var sh=[];
 		for(var i=1;i<arr.length;i++){
 			sh.push(arr[i]);
 		}
 		console.log(sh);
 	}
 	myshift(arr);
	</script>
</head>
<body>
	
</body>
</html>